#include "baseconversion.h"

#include <QVBoxLayout>
#include <QPixmap>
#include <QPainter>
#include <DTitlebar>

DWIDGET_USE_NAMESPACE

BaseConversion::BaseConversion(DMainWindow *parent) :
    DMainWindow(parent)
{
    initUi();
    this->titlebar()->setBackgroundTransparent(true);
    this->titlebar()->setIcon(QIcon(":/icon/base-conversion.svg"));
   // this->setWindowIcon(QIcon(":/icon/change.png"));
}

BaseConversion::~BaseConversion()
{

}

void BaseConversion::initUi()
{
    setAutoFillBackground(true);
    //setPalette(QPalette(Qt::white));

    // 整形转换界面
    m_interConversion = new InterConversion(this);
    m_interConversion->setGeometry(0, 50, 450, 300);
    m_interConversion->setMinimumSize(450, 350);

    //浮点型转换界面
    m_floatConcersion = new FloatConversion(this);
    m_floatConcersion->setGeometry(0, 360, 450, 250);
    m_floatConcersion->setMinimumSize(450, 250);

    //字符串转换界面
    m_strConversion = new StrConversion(this);
    m_strConversion->setGeometry(450, 50, 450, 530);
    m_strConversion->setMinimumSize(450, 530);

}

void BaseConversion::paintEvent(QPaintEvent *)
{
//    QPainter painter(this);
//    QPixmap pix(":/icon/change.png");
//    painter.drawPixmap(0, 0, pix);
}


